/**
 * Notes: 员工实体 - 宠物门店预约小程序
 * Date: 2025-01-27 
 */

const BaseModel = require('./base_model.js');
class EmployeeModel extends BaseModel {}

// 集合名
EmployeeModel.CL = "ax_employees";

EmployeeModel.DB_STRUCTURE = {
	_pid: 'string|true',
	_id: 'string|true|comment=员工唯一ID',
	storeId: 'string|true|comment=所属门店ID',
	
	name: 'string|true|comment=员工姓名',
	title: 'string|false|comment=职称/头衔',
	tags: 'array|false|comment=标签',
	avatar: 'string|false|comment=员工照片',
	status: 'int|true|default=1|comment=状态 1:在岗, 0:休假',
	
	createTime: 'int|true|comment=创建时间',
	updateTime: 'int|true|comment=更新时间',
}

// 字段前缀
EmployeeModel.FIELD_PREFIX = "";

// 禁用自动添加时间、IP和ID字段
EmployeeModel.UPDATE_TIME = false;
EmployeeModel.UPDATE_IP = false;
EmployeeModel.ADD_ID = false;

/**
 * 员工状态
 */
EmployeeModel.STATUS = {
	OFFLINE: 0,   // 休假
	ONLINE: 1     // 在岗
};

EmployeeModel.STATUS_DESC = {
	OFFLINE: '休假',
	ONLINE: '在岗'
};

module.exports = EmployeeModel;
